﻿using System.Xml.Serialization;
using Harvest.Api.Types;

namespace Harvest.Api.Model.Internal
{

  //<project>
  //  <active type="boolean">false</active>
  //  <active-task-assignments-count type="integer">9</active-task-assignments-count>
  //  <active-user-assignments-count type="integer">1</active-user-assignments-count>
  //  <basecamp-id type="integer" nil="true"></basecamp-id>
  //  <bill-by>none</bill-by>
  //  <billable type="boolean">false</billable>
  //  <budget type="decimal" nil="true"></budget>
  //  <budget-by>none</budget-by>
  //  <cache-version type="integer">3825954146</cache-version>
  //  <client-id type="integer">135194</client-id>
  //  <code></code>
  //  <cost-budget type="decimal" nil="true"></cost-budget>
  //  <cost-budget-include-expenses type="boolean">false</cost-budget-include-expenses>
  //  <created-at type="datetime">2009-04-20T08:45:37Z</created-at>
  //  <fees type="decimal" nil="true"></fees>
  //  <highrise-deal-id type="integer" nil="true"></highrise-deal-id>
  //  <hourly-rate type="decimal" nil="true"></hourly-rate>
  //  <id type="integer">339448</id>
  //  <name>Consulting</name>
  //  <notify-when-over-budget type="boolean">false</notify-when-over-budget>
  //  <over-budget-notification-percentage type="decimal">100.0</over-budget-notification-percentage>
  //  <over-budget-notified-at type="date" nil="true"></over-budget-notified-at>
  //  <show-budget-to-all type="boolean">false</show-budget-to-all>
  //  <updated-at type="datetime">2010-07-23T08:07:00Z</updated-at>
  //  <estimate nil="true"></estimate>
  //  <estimate-by>none</estimate-by>
  //  <notes></notes>
  //</project>

    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// Don't change the XmlElement attributes, otherwise (de)serialization will fail.
    /// </remarks>
    [XmlRoot(ElementName = "project", IsNullable = false)]
    public class ProjectItem
    {

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "id", IsNullable = true)]
        public NullableInt Id { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "active ")]
        public bool Active { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "billable ")]
        public bool Billable { get; set; }

        // Tasks, People, none
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "bill-by")]
        public string BillBy { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "client-id", IsNullable = true)]
        public NullableInt ClientId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "code")]
        public string Code { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "notes")]
        public string Notes { get; set; }

        // project, project_cost, task, person, none
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "budget-by")]
        public string BudgetBy { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "budget", IsNullable = true)]
        public NullableDouble Budget { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "fees")]
        public string Fees { get; set; }

        // Added because of attribute usage in time tracking api
        /// <summary>
        /// 
        /// </summary>
        [XmlElement(ElementName = "client")]
        public string Client { get; set; }

    }

}
